A pulse width modulation (PWM) circuit can be used to perform as a digital-to-analog converter (DAC) by applying the PWM output signal to a low-pass filter having a corner frequency that is low enough to eliminate the high-frequency components of the PWM signal. PWM DAC circuits are especially useful for generating voltage references with microcontrollers because they can fairly easily generate linear analog outputs by applying appropriate low-pass filters to the PWM outputs that are available on many microcontrollers. These simplistic PWM DAC circuits, however, tend to be inaccurate and require difficult trade offs between resolution and response time. Obtaining higher resolution requires a longer PWM count chain which produces a lower fundamental frequency.
FIG. 1 illustrates a prior art PWM DAC circuit in which the outputs from two separate 8-bit PWMs 10 and 12 are combined through an analog summing/filter circuit 14 to provide a higher resolution DAC. Although this type of circuit may provide higher resolution, it may require highly accurate divider resistors and complex active circuitry to provide an accurate output. Additional problems may include the need to provide heavy filtering to extract the DC component from the PWM ripple which reduces the operating speed, and the need to compensate for internal component resistances in the active analog circuitry.
FIG. 2 illustrates another prior art PWM DAC circuit in which a PWM clock signal is used to dither between two adjacent output values of an 8-bit DAC. The DAC 16 outputs a value of N when the clock input is low and a value of N+1 when the clock input is high. Thus, by using a PWM signal as the clock input and filtering the DAC output with a low-pass filter 18, the circuit provides additional discrete analog output levels between the DAC output levels.
The technique illustrated in FIG. 2, however, reduces the operating speed substantially because the DAC output must be allowed to settle repeatedly at the different values of N and N+1 as the clock input transitions in response to the PWM input. Moreover, the circuit of FIG. 2 requires complex, dedicated and custom digital circuitry in the DAC to implement.